/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package appicalculadora;

/**
 *
 * @author Oscar Franco
 */
public class IntCalculadora implements ICalculadora{
    
    public String sumar(String n1,String n2)
    {
        return  String.valueOf(Integer.valueOf(n1)+Integer.valueOf(n2));
    }
    public String restar(String n1,String n2)
    {
        return  String.valueOf(Integer.valueOf(n1)-Integer.valueOf(n2));
    }
    public String multiplicar(String n1,String n2)
    {
        return  String.valueOf(Integer.valueOf(n1)*Integer.valueOf(n2));
    }
    public String dividir(String n1,String n2) throws Exception
    {
        if(Integer.valueOf(n1)!=0)
            return  String.valueOf(Integer.valueOf(n1)/Integer.valueOf(n2));
        else
            throw new Exception("Division por cero");
    }
}
